package com.lx;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class vote
{
    public static void main(String[] args) {
        Map<String,Integer> map = new HashMap<>();
        Scanner sc = new Scanner(System.in);
        int number = sc.nextInt();
        int count = 0;
        while(count<number)
        {
            String s = sc.next();
            Integer integer = map.get(s);
//            System.out.println(integer);
            if(integer == null)
            {
                map.put(s,1);
            }
            else
            {
                map.put(s,integer+1);
            }
            count++;
        }
        Set<String> strings = map.keySet();
        for (String string : strings) {
            System.out.println(string+"="+map.get(string));
        }
        System.out.println(map);
    }
}
